<template>
	<view>
		<view class="subsection">
			<view :class="item.i == currents ? 'active':''" v-for="item in subsectionList" :key="item.i" @click="clickSub(item.i)">{{ item.title }}</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			subsectionList: {
				type: Array,
				default: []
			},
			current: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
			}
		},
		computed: {
			currents: {
				get() {
					return this.current
				},
				set() {}
			}
		},
		methods: {
			clickSub(index) {
				this.$emit('change', index)
				this.currents = index
			}
		}
	}
</script>

<style lang="scss" scoped>
	// 选项卡
	.subsection {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 35rpx;
		height: 89rpx;
		color: #999999;
		font-weight: 400;
		.active {
			color: #000000;
			font-weight: 1000;
			font-size: 32rpx;
		}
	}
</style>
